<template>
	<view class="cont">
		<view class="number webkit">
			<text class="flex mid" v-cloak>订单号： v-cloakres.logno}}</text>
			<button type="primary" @click="ctrlC" :data-num="res.logno">复制</button>
		</view>
		<view class="img">
			<view class="title">平台收款方式</view>
			<image v-if="res.payTypes == 'alipay'" :src="res.alipay" mode=""></image>
			<image v-else-if="res.payTypes == 'wechat'" :src="res.wechat" mode="aspectFill"></image>
			<view class="bank" v-else>
				<view v-cloak>开户银行：{{res.bank}}</view>
				<view v-cloak>开户人：{{res.bankpeople}}</view>
				<view v-cloak>银行卡号：{{res.bankcard}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				res:[],
				openid:"",
				id:""
			};
		},
		onLoad:function(e){
			this.id = e.id
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
		},
		methods:{
			setAjax(){
				uni.request({
					url: 'http://m.wpweipin.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=member.recharge.c2cdetail&app=1&id='+this.id,
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						uni.hideLoading()
						this.res = res.data
						console.log(res.data)
					},
					fail: () => {},
					complete: () => {}
				});
			},
			ctrlC(e){
				uni.setClipboardData({
					data: e.currentTarget.dataset.num,
					success: function () {
						uni.showToast({
							title: '复制成功'
						});
					}
				});
			}
		}
	}
</script>

<style>.cont{padding-top:20upx;}.number{background:#fff;padding:20upx 30upx;}.number button{border:1px solid #f55;outline:none;background:#fff;color:#f55;line-height:26px;width:64px;border-radius:3px;font-size:26upx;}.img{padding:20upx 30upx;background:#fff;margin-top:20upx;}.img .title{margin-bottom:30upx;}.img image{width:600upx;margin:0 auto;display:block;height:824upx;}.img .bank view{text-align:center;}</style>